package com.Qinmeiwei.web.pojo.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the event table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="event"
 */

public abstract class BaseEvent  implements Serializable {

	public static String REF = "Event";
	public static String PROP_ENABLED = "enabled";
	public static String PROP_DESCRIPTION = "description";
	public static String PROP_LABEL_KEY = "labelKey";
	public static String PROP_TYPE_CODE = "typeCode";
	public static String PROP_CREATE_TIME = "createTime";
	public static String PROP_APP_ID = "appId";
	public static String PROP_ID = "id";
	public static String PROP_EVENT_LEVEL = "eventLevel";


	// constructors
	public BaseEvent () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseEvent (java.lang.String id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseEvent (
		java.lang.String id,
		com.Qinmeiwei.web.pojo.EventType typeCode,
		java.lang.String labelKey,
		java.lang.Byte enabled,
		java.lang.String appId,
		java.util.Date createTime) {

		this.setId(id);
		this.setTypeCode(typeCode);
		this.setLabelKey(labelKey);
		this.setEnabled(enabled);
		this.setAppId(appId);
		this.setCreateTime(createTime);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.String id;

	// fields
	private java.lang.String labelKey;
	private java.lang.Byte enabled;
	private java.lang.Byte eventLevel;
	private java.lang.String description;
	private java.lang.String appId;
	private java.util.Date createTime;

	// many to one
	private com.Qinmeiwei.web.pojo.EventType typeCode;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="event_code"
     */
	public java.lang.String getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.String id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: label_key
	 */
	public java.lang.String getLabelKey () {
		return labelKey;
	}

	/**
	 * Set the value related to the column: label_key
	 * @param labelKey the label_key value
	 */
	public void setLabelKey (java.lang.String labelKey) {
		this.labelKey = labelKey;
	}



	/**
	 * Return the value associated with the column: enabled
	 */
	public java.lang.Byte getEnabled () {
		return enabled;
	}

	/**
	 * Set the value related to the column: enabled
	 * @param enabled the enabled value
	 */
	public void setEnabled (java.lang.Byte enabled) {
		this.enabled = enabled;
	}



	/**
	 * Return the value associated with the column: event_level
	 */
	public java.lang.Byte getEventLevel () {
		return eventLevel;
	}

	/**
	 * Set the value related to the column: event_level
	 * @param eventLevel the event_level value
	 */
	public void setEventLevel (java.lang.Byte eventLevel) {
		this.eventLevel = eventLevel;
	}



	/**
	 * Return the value associated with the column: description
	 */
	public java.lang.String getDescription () {
		return description;
	}

	/**
	 * Set the value related to the column: description
	 * @param description the description value
	 */
	public void setDescription (java.lang.String description) {
		this.description = description;
	}



	/**
	 * Return the value associated with the column: app_id
	 */
	public java.lang.String getAppId () {
		return appId;
	}

	/**
	 * Set the value related to the column: app_id
	 * @param appId the app_id value
	 */
	public void setAppId (java.lang.String appId) {
		this.appId = appId;
	}



	/**
	 * Return the value associated with the column: create_time
	 */
	public java.util.Date getCreateTime () {
		return createTime;
	}

	/**
	 * Set the value related to the column: create_time
	 * @param createTime the create_time value
	 */
	public void setCreateTime (java.util.Date createTime) {
		this.createTime = createTime;
	}



	/**
	 * Return the value associated with the column: type_code
	 */
	public com.Qinmeiwei.web.pojo.EventType getTypeCode () {
		return typeCode;
	}

	/**
	 * Set the value related to the column: type_code
	 * @param typeCode the type_code value
	 */
	public void setTypeCode (com.Qinmeiwei.web.pojo.EventType typeCode) {
		this.typeCode = typeCode;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.Qinmeiwei.web.pojo.Event)) return false;
		else {
			com.Qinmeiwei.web.pojo.Event event = (com.Qinmeiwei.web.pojo.Event) obj;
			if (null == this.getId() || null == event.getId()) return false;
			else return (this.getId().equals(event.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}